<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'users-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'u_name'); ?>
		<?php echo $form->textField($model,'u_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'u_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'u_email'); ?>
		<?php echo $form->textField($model,'u_email',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'u_email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'u_pass'); ?>
		<?php echo $form->passwordField($model,'u_pass',array('size'=>60,'maxlength'=>255,'value'=>'')); ?>
		<?php echo $form->error($model,'u_pass'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'u_state'); ?>
		<?php echo $form->dropDownList($model,'u_state',array(
				Admins::STATE_ACTIVE=>'active',
				Admins::STATE_DISABLED=>'disabled',
			));
		?>
		<?php echo $form->error($model,'u_state'); ?>
	</div>

<?php if (Yii::app()->user->checkAccess('changeRole')) { ?>
	<div class="row">
		<?php echo $form->labelEx($model,'u_role'); ?>
		<?php echo $form->dropDownList($model,'u_role',array(
				Admins::ROLE_USER=>Admins::ROLE_USER,
				Admins::ROLE_ADMIN=>Admins::ROLE_ADMIN,
				Admins::ROLE_ROOT=>Admins::ROLE_ROOT,
			));
		?>
		<?php echo $form->error($model,'u_role'); ?>
	</div>
<?php } ?>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->